package nc.ui.yyam.bd.category;

import nc.ui.trade.bsdelegate.BDBusinessDelegator;
import nc.ui.trade.bsdelegate.BusinessDelegator;
import nc.ui.trade.pub.IVOTreeDataByID;
import nc.vo.pub.SuperVO;
import nc.vo.yyam.bd.category.CategoryVO;
/**
 * 
 * @date 2013-2-20
 * @author tangshh
 * @version yyam 1.0
 *
 */
public class MyTreeCardDate implements IVOTreeDataByID {

	private String assetsClass=null;
	public MyTreeCardDate(String assetsClass) {
		 this.assetsClass=assetsClass;
	}

	public String getIDFieldName() {
		 
		return CategoryVO.PK_CTG;
	}

	public String getParentIDFieldName() {
		return CategoryVO.PKPARENT_CTG;
	}

	public String getShowFieldName() {
		return CategoryVO.CTG_CODE+","+CategoryVO.CTG_NAME;
	}

	public SuperVO[] getTreeVO() {
		BusinessDelegator delegator= new BDBusinessDelegator();
		SuperVO[] vos=null;
		try {
			 vos=delegator.queryByCondition(CategoryVO.class, "vdef1='"+assetsClass+"' order by ctg_code ");
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return vos;
	}

}
